#cs ------------------------Create file Word by Microsof Word----------------------------------------------------

 AutoIt Version: 3.3.8.1
 Author:         Loanuynh
 Written Date:	
 Modified Date:

 Script Function:
	

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <library.au3>
#include <Word.au3>

ShellExecute("winword.exe")
WinWaitActive("Document1 - Microsoft Word")
WinActivate("Document1 - Microsoft Word")
WinSetState("Document1 - Microsoft Word","",@SW_MAXIMIZE)
Sleep(300)
MouseClick( "left",300,300)
Send("This is a text")
Sleep(200)
Send("^s")
WinWaitActive("Save As")
WinActivate("[TITLE:SaveAs; CLASS:#32770]","Word Document")
;ControlClick("[TITLE:SaveAs; CLASS:#32770]","","[CLASS:ComboBox; INSTANCE:2]")
ControlCommand("TITLE:SaveAs; CLASS:#32770","","[CLASS:ComboBox; INSTANCE:2]","ShowDropDown","Word 97-2003")
;Send("Word 97-2003 Document")
Sleep(2000)
#cs
ControlClick("[TITLE:SaveAs; CLASS:#32770]","This is a text","[CLASS:Edit; INSTANCE:1]")
Send("^a")
Send("{DEL}")
Send("D:\Auto-doc.doc")
WinWaitActive("Save As","&Save")
ControlClick("Save As","&Save", "[CLASS:Button; INSTANCE:8]")
;WinClose("Auto-docx.docx - Microsoft Word","")
Send("{ALT}")
Send("fx")
#ce
